package Delegare;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Lista {	
	BufferedReader tastatura=new BufferedReader(new InputStreamReader(System.in));
	List<Produs> lista=new ArrayList<Produs>();
	public void adauga() throws IOException {
		System.out.println("Nume:");
		String nume=tastatura.readLine();
		System.out.println("Cod:");
		int cod=Integer.parseInt(tastatura.readLine());
		System.out.println("Pret:");
		int pret=Integer.parseInt(tastatura.readLine());
		System.out.println("Cantitate:");
		int cantitate=Integer.parseInt(tastatura.readLine());
		lista.add(new Produs(nume, cod, pret, cantitate));
	}
	@SuppressWarnings({ "unused", "rawtypes" })
	public void suprima() throws NumberFormatException, IOException {
		System.out.println("Introduceti codul produsului pe care doriti sa il suprimati:");
		int cod_suprimat=Integer.parseInt(tastatura.readLine());
		ListIterator it=lista.listIterator();
	}
	@SuppressWarnings("rawtypes")
	public void afisare(){
		ListIterator it=lista.listIterator();
		while(it.hasNext())
			System.out.println(it.next());
	}
}
